package com.moguhoutai.biz;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.moguhoutai.dao.AreaMapper;
import com.moguhoutai.model.Area;
import com.moguhoutai.util.BusinessException;

@Service
public class AreaBiz {
    @Resource
	private AreaMapper aMapperdao;
    
    public Area findById(int areaId)throws BusinessException{
    	try {
			return aMapperdao.findById(areaId);
		} catch (Exception e) {
			e.printStackTrace();
			throw new  BusinessException("E06B01");
		}
    }
    
    public List<Area> findBycity(int cityId) throws BusinessException  {
  		try {
  		  return aMapperdao.findBycity(cityId);
  		} catch (Exception e) {
  			e.printStackTrace();
  			throw new BusinessException("E06B06");
  			
  		}
    }
    
    public void save(Area area)throws BusinessException{
    	try {
			aMapperdao.insert(area);
		} catch (Exception e) {
			e.printStackTrace();
  			throw new BusinessException("E06B01");
		}
    	
    }
    
}
